<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/iconfont.css">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/swiper.min.css">
<link rel="stylesheet" href="css/styles.css">
<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
<script src="js/bootstrap.min.js" charset="UTF-8"></script>
<script src="js/swiper.min.js" charset="UTF-8"></script>
<script src="js/global.js" charset="UTF-8"></script>
<script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script>
<script type="text/javascript" src="layer/layer.js"></script>
<title>广内殿</title>
<script type="text/javascript">
	$(function(){
		var u=JSON.parse(window.localStorage.getItem("user"));
		console.log(u);
		if (u!=null) {
			$("#yinCang").hide();
			$("#xianShi").show();
			$("#uName").html(u.username);
			$("#uId").html(u.uid);
		}
		$.post("getAddress",{
			belongToUserId:u.uid
		},function(res){
			for (var i = 0; i < res.length; i++) {
				$("#myDiv").append(`	
					<div class="radio-line radio-box">
					<label class="radio-label ep" title="福建省 福州市 鼓楼区 温泉街道 五四路159号世界金龙大厦20层B北 福州rpg.blue网络 （喵喵喵 收） 153****9999">
						<input name="addr" checked="" value="0" autocomplete="off" type="radio"><i class="iconfont icon-radio"></i>
						${res[i].province} ${res[i].city} ${res[i].address}   (${res[i].a_name} 收)  ${res[i].a_phone}
					</label>
					<a href="javascript:;" class="default">默认地址</a>
					<a href="udai_address_edit.html" class="edit">修改</a>
					</div>
				`)
			}
		},"json");
		
		$.post("getOrdersssss",{
			userId:u.uid
		},function(res){
			console.log(res);
			for (var i = 0; i < res.length; i++) {
				$("#orderId").append(`	
					<tr>
						<th scope="row"><div
									class="img">
									<img src="images/${res[i].books.img}" alt="" class="cover">
								</div></th>
						<td>
							<div class="name ep3">${res[i].books.name}</div>
						</td>
						<td>¥${res[i].books.sellPrice}.0</td>
						<td>${res[i].number}</td>
						<td>¥0.0</td>
						<td>¥${res[i].totalMoney}.0</td>
					</tr>
				`)
			}
		},"json");
	});
	
	function fuKuan(){
		var u=JSON.parse(window.localStorage.getItem("user"));
		$.post("updateSta",{
			userId: u.uid,
		},function(res){
			if (res.code=="1") {
				layer.msg("修改失败");
			} else {
				window.location.href="cheng_gong.html";
			}
		},"json");
	}
</script>
</head>
<body>
	<!-- 顶部tab -->
	<div class="tab-header">
		<div class="inner">
			<div class="pull-left">
				<div class="pull-left">
					嗨，欢迎来到<span class="cr">广内殿</span>
				</div>
			</div>
			<div class="pull-right">
				<span id="yinCang"> <a href="login.html"><span class="cr">登录</span></a>
					<a href="login2.html">注册</a>
				</span> <span style="display: none;" id="xianShi"> uid:<span
					id="uId"></span> 欢迎:<span id="uName"></span>
				</span> <a href="udai_setting.html">个人中心</a> <a href="udai_order.html">我的订单</a>
			</div>
		</div>
	</div>
	<!-- 顶部标题 -->
	<div class="bgf5 clearfix">
		<div class="top-user">
			<div class="inner">
				<a class="logo" href="index.html"><img
					src="images/icons/logo.jpg" alt="U袋网" class="cover"></a>
				<div class="title">购物车</div>
			</div>
		</div>
	</div>
	<div class="content clearfix bgf5">
		<section class="user-center inner clearfix">
			<div class="user-content__box clearfix bgf">
				<div class="title">购物车-确认支付</div>
				<div class="shop-title">收货地址</div>
				<form action="" class="shopcart-form__box">
					<div id="myDiv" class="addr-radio"></div>
					<div class="add_addr">
						<a href="udai_address_edit.html">添加新地址</a>
					</div>
					<div class="shop-order__detail">
						<table class="table">
							<thead>
								<tr>
									<th width="120"></th>
									<th width="300">商品信息</th>
									<th width="150">单价</th>
									<th width="200">数量</th>
									<th width="200">运费</th>
									<th width="80">总价</th>
								</tr>
							</thead>
							<tbody id="orderId">

							</tbody>
						</table>
					</div>
					<div style="display: none;" class="shop-title">确认订单</div>
					<div class="pay-mode__box">
						<div class="radio-line radio-box">
							<label class="radio-label ep"> <input name="pay-mode"
								value="1" autocomplete="off" type="radio"><i
								class="iconfont icon-radio"></i> <span class="fz16">余额支付</span>
							</label>
							<div class="pay-value">支付</div>
						</div>
						<div class="radio-line radio-box">
							<label class="radio-label ep"> <input name="pay-mode"
								value="2" autocomplete="off" type="radio"><i
								class="iconfont icon-radio"></i> <img
								src="images/icons/alipay.png" alt="支付宝支付">
							</label>
							<div class="pay-value">支付</div>
						</div>
						<div class="radio-line radio-box">
							<label class="radio-label ep"> <input name="pay-mode"
								value="3" autocomplete="off" type="radio"><i
								class="iconfont icon-radio"></i> <img
								src="images/icons/paywechat.png" alt="微信支付">
							</label>
							<div class="pay-value">支付</div>
						</div>
					</div>
					<div class="user-form-group shopcart-submit">
						<button onclick="fuKuan()" type="button" class="btn">确认付款</button>
					</div>
					<script>
						$(document).ready(function(){
							$(this).on('change','input',function() {
								$(this).parents('.radio-box').addClass('active').siblings().removeClass('active');
							})
						});
					</script>
				</form>
			</div>
		</section>
	</div>
	<!-- 右侧菜单 -->
	<div class="right-nav">
		<ul class="r-with-gotop">
			<li class="r-toolbar-item"><a href="udai_welcome.html"
				class="r-item-hd"> <i class="iconfont icon-user" data-badge="0"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">用户中心</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="udai_shopcart.html"
				class="r-item-hd"> <i class="iconfont icon-cart"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">购物车</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="udai_collection.html"
				class="r-item-hd"> <i class="iconfont icon-aixin"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">我的收藏</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="" class="r-item-hd"> <i
					class="iconfont icon-liaotian"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">联系客服</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="issues.html"
				class="r-item-hd"> <i class="iconfont icon-liuyan"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">留言反馈</span>
					</div>
			</a></li>
			<li class="r-toolbar-item to-top"><i class="iconfont icon-top"></i>
				<div class="r-tip__box">
					<span class="r-tip-text">返回顶部</span>
				</div></li>
		</ul>
		<script>
			$(document).ready(function(){ $('.to-top').toTop({position:false}) });
		</script>
	</div>
	<!-- 底部信息 -->
	<div class="footer">
		<div class="footer-tags">
			<div class="tags-box inner">
				<div class="tag-div">
					<img src="images/icons/footer_1.gif" alt="厂家直供">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_2.gif" alt="一件代发">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_3.gif" alt="美工活动支持">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_4.gif" alt="信誉认证">
				</div>
			</div>
		</div>
		<div class="footer-links inner">
			<dl>
				<dt>U袋网</dt>
				<a href="temp_article/udai_article10.html"><dd>企业简介</dd></a>
				<a href="temp_article/udai_article11.html"><dd>加入U袋</dd></a>
				<a href="temp_article/udai_article12.html"><dd>隐私说明</dd></a>
			</dl>
			<dl>
				<dt>服务中心</dt>
				<a href="temp_article/udai_article1.html"><dd>售后服务</dd></a>
				<a href="temp_article/udai_article2.html"><dd>配送服务</dd></a>
				<a href="temp_article/udai_article3.html"><dd>用户协议</dd></a>
				<a href="temp_article/udai_article4.html"><dd>常见问题</dd></a>
			</dl>
			<dl>
				<dt>新手上路</dt>
				<a href="temp_article/udai_article5.html"><dd>如何成为代理商</dd></a>
				<a href="temp_article/udai_article6.html"><dd>代销商上架教程</dd></a>
				<a href="temp_article/udai_article7.html"><dd>分销商常见问题</dd></a>
				<a href="temp_article/udai_article8.html"><dd>付款账户</dd></a>
			</dl>
		</div>
		<div class="copy-box clearfix">
			<ul class="copy-links">
				<a href="agent_level.html"><li>网店代销</li></a>
				<a href="class_room.html"><li>U袋学堂</li></a>
				<a href="udai_about.html"><li>联系我们</li></a>
				<a href="temp_article/udai_article10.html"><li>企业简介</li></a>
				<a href="temp_article/udai_article5.html"><li>新手上路</li></a>
			</ul>
			<!-- 版权 -->
			<p class="copyright">
				© 2005-2017 U袋网 版权所有，并保留所有权利<br>
				ICP备案证书号：闽ICP备16015525号-2&nbsp;&nbsp;&nbsp;&nbsp;福建省宁德市福鼎市南下村小区（锦昌阁）1栋1梯602室&nbsp;&nbsp;&nbsp;&nbsp;Tel:
				18650406668&nbsp;&nbsp;&nbsp;&nbsp;E-mail: 18650406668@qq.com
			</p>
		</div>
	</div>
</body>
</html>